﻿<controls:MetroWindow x:Class="ProjectGroep3.AdminWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
        Title="Admin Panel" Height="395.134" Width="983.617" Foreground="Red" Background="White" ResizeMode="CanMinimize" Icon="Resources/Groep3.png">
    <controls:MetroWindow.Flyouts>
        <controls:FlyoutsControl>
            <controls:Flyout  Name="companyFlyout"  Position="Right" >
                <Grid Margin="10,0,0,0" Width="230">
                    <Label Content="Name" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <TextBox x:Name="txtCName" Grid.Column="2" HorizontalAlignment="Left" Height="23" Margin="70,0,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
                    <Label Content="Street" Grid.Column="1" HorizontalAlignment="Left" Margin="0,30,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <TextBox x:Name="txtCStreet" Grid.Column="2" HorizontalAlignment="Left" Height="23" Margin="70,30,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
                    <Label Content="ZipCode" Grid.Column="1" HorizontalAlignment="Left" Margin="0,60,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <TextBox x:Name="txtCZip" Grid.Column="2" HorizontalAlignment="Left" Height="23" Margin="70,60,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
                    <Label Content="City" Grid.Column="1" HorizontalAlignment="Left" Margin="0,90,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <TextBox x:Name="txtCCity" Grid.Column="2" HorizontalAlignment="Left" Height="23" Margin="70,90,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
                    <Label Content="Country" Grid.Column="1" HorizontalAlignment="Left" Margin="0,120,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <TextBox x:Name="txtCCountry" Grid.Column="2" HorizontalAlignment="Left" Height="23" Margin="70,120,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
                    <Label Content="Email" Grid.Column="1" HorizontalAlignment="Left" Margin="0,150,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <TextBox x:Name="txtCEmail" Grid.Column="2" HorizontalAlignment="Left" Height="23" Margin="70,150,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
                    <Label Content="Phone" Grid.Column="1" HorizontalAlignment="Left" Margin="0,180,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <TextBox x:Name="txtCPhone" Grid.Column="2" HorizontalAlignment="Left" Height="23" Margin="70,180,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
                    <Label Content="Employees" Grid.Column="1" HorizontalAlignment="Left" Margin="0,210,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <TextBox x:Name="txtCEmployees" Grid.Column="2" HorizontalAlignment="Left" Height="23" Margin="70,210,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
                    <Button x:Name="btnFlyoutUpdate" Content="Update" Height="35" Width="129" Grid.Column="1" Grid.ColumnSpan="3" Margin="0,240,0,0" Click="btnFlyoutUpdate_Click"/>
                    <Button x:Name="btnFlyoutCreate" Content="Create" Height="35" Width="129" Grid.Column="1" Grid.ColumnSpan="3" Margin="0,240,0,0" Click="btnFlyoutCreate_Click"/>
                </Grid>
            </controls:Flyout>

            <controls:Flyout  Name="contractFlyout"  Position="Right" >
                <Grid Margin="10,0,0,0" Width="230">
                    <Label Content="Company" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <ComboBox x:Name="cmbCompany" IsReadOnly="True" IsEditable="True" Text ="Select a company." Height="23" Margin="70,0,0,0" VerticalAlignment="Top" Width="130" />
                    
                    <Label Content="Formula" Grid.Column="1" HorizontalAlignment="Left" Margin="0,30,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <ComboBox x:Name="cmbConForm" IsReadOnly="True" IsEditable="True" Height="23" Margin="70,30,0,0" VerticalAlignment="Top" Width="130" 
                              Text="{Binding Path=Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    
                    <Label Content="StartDate" Grid.Column="1" HorizontalAlignment="Left" Margin="0,60,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <DatePicker x:Name="dtpConStartDate"   Height="23" Margin="70,60,0,0" VerticalAlignment="Top" Width="130" /> 
                    
                    <Label Content="EndDate" Grid.Column="1" HorizontalAlignment="Left" Margin="0,90,0,0" VerticalAlignment="Top" Width="82" Grid.ColumnSpan="3"/>
                    <DatePicker x:Name="dtpConEndDate"   Height="23" Margin="70,90,0,0" VerticalAlignment="Top" Width="130" 
                                 Text="{Binding Path=EndDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    
                    <Button x:Name="btnFlyoutUpdateContract" Content="Update" Height="35" Width="129" Grid.Column="1" Grid.ColumnSpan="3" Margin="0,260,0,0" Click="btnFlyoutUpdateContract_Click"/>
                    <Button x:Name="btnFlyoutCreateContract" Content="Create" Height="35" Width="129" Grid.Column="1" Grid.ColumnSpan="3" Margin="0,260,0,0" Click="btnFlyoutCreateContract_Click"/>
                </Grid>
            </controls:Flyout>
        </controls:FlyoutsControl>
    </controls:MetroWindow.Flyouts>

    <Grid>
        <TabControl HorizontalAlignment="Stretch" Height="auto" Margin="30,20,-10,0" VerticalAlignment="Stretch" Width="auto">
            <TabItem Header="Users" Width="136">
                <Grid Background="White" Margin="0,-4,13,4">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="243*"/>
                        <ColumnDefinition Width="50*"/>
                        <ColumnDefinition Width="17"/>
                        <ColumnDefinition Width="148*"/>
                        <ColumnDefinition Width="483*"/>
                    </Grid.ColumnDefinitions>
                    <DataGrid x:Name="dtgUsers" AutoGenerateColumns="False" ItemsSource="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,49,0,0" Height="236" Width="402" Grid.ColumnSpan="4" IsReadOnly="True" Foreground="#CC119EDA" >
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Username" Width="*" Binding="{Binding Path=UserName}" />
                            <DataGridTextColumn Header="Email" Width="*" Binding="{Binding Path=Email}" />
                        </DataGrid.Columns>
                    </DataGrid>
                    <Button x:Name="btnMakeAdmin" Content="Make Admin" HorizontalAlignment="Left" Height="35" Margin="133,49,0,0" VerticalAlignment="Top" Width="129" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Grid.ColumnSpan="2" Grid.Column="3" Click="btnMakeAdmin_Click" />
                    <Button x:Name="btnRemoveUser" Content="Remove" HorizontalAlignment="Left" Height="35" Margin="133,102,0,0" VerticalAlignment="Top" Width="129"  BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Grid.ColumnSpan="2" Grid.Column="3" Click="btnRemoveUser_Click"/>
                    <Button x:Name="btnAdmins" Content="Admins" HorizontalAlignment="Left" Height="29" Margin="219,10,0,0" VerticalAlignment="Top" Width="192" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnAdmins_Click" Grid.ColumnSpan="4" />
                    <Button x:Name="btnUsers" Content="Users" HorizontalAlignment="Left" Height="29" Margin="22,8,0,0" VerticalAlignment="Top" Width="180" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnUsers_Click" />
                </Grid>
            </TabItem>
            <TabItem Header="Company's" Width="187">
                <Grid Background="White" Margin="-14,-3,14,3">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="296*"/>
                        <ColumnDefinition Width="17"/>
                        <ColumnDefinition Width="150*"/>
                        <ColumnDefinition Width="36*"/>
                        <ColumnDefinition Width="453*"/>
                    </Grid.ColumnDefinitions>
                    <DataGrid x:Name="dtgCompany" AutoGenerateColumns="False" ItemsSource="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,49,0,0" Height="236" Width="500" Grid.ColumnSpan="3" IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Name" Width="100" Binding="{Binding Path=Name}" />
                            <DataGridTextColumn Header="Street" Width="150" Binding="{Binding Path=Street}" />
                            <DataGridTextColumn Header="City" Width="120" Binding="{Binding Path=City}" />
                            <DataGridTextColumn Header="Employees" Width="*" Binding="{Binding Path=Employees}" />
                        </DataGrid.Columns>
                    </DataGrid>
                    <Button x:Name="btnRemoveCompany" Content="Remove" HorizontalAlignment="Left" Height="29" Margin="15,197,0,0" VerticalAlignment="Top" Width="108" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnRemoveCompany_Click" Grid.Column="4" />
                    <Button x:Name="btnUpdate" Content="Update" HorizontalAlignment="Left" Height="29" Margin="15,137,0,0" VerticalAlignment="Top" Width="108" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnUpdate_Click" Grid.Column="4"/>
                    <Button x:Name="btnCreateCompany" Content="Create" HorizontalAlignment="Left" Height="29" Margin="15,78,0,0" VerticalAlignment="Top" Width="108" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnCreate_Click" Grid.Column="4"/>
                </Grid>
            </TabItem>
            <TabItem Header="Contracts" Width="178">
                <Grid Background="White" Margin="-14,-3,14,3">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="296*"/>
                        <ColumnDefinition Width="17"/>
                        <ColumnDefinition Width="150*"/>
                        <ColumnDefinition Width="36*"/>
                        <ColumnDefinition Width="453*"/>
                    </Grid.ColumnDefinitions>
                    <DataGrid x:Name="dtgContracts" AutoGenerateColumns="False" ItemsSource="{Binding}" HorizontalAlignment="left" VerticalAlignment="Top" Margin="10,49,0,0" Height="236" Width="470" Grid.ColumnSpan="5" IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridCheckBoxColumn ElementStyle="{DynamicResource MetroDataGridCheckBox}"
            					EditingElementStyle="{DynamicResource MetroDataGridCheckBox}"
            					Header=""
            					Binding="{Binding IsSelected, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type DataGridRow}}}"
                                        />
                            <DataGridTextColumn Header="Id" Width="*" Binding="{Binding Number}"  />
                            <DataGridTextColumn Header="StartDate" Width="*" Binding="{Binding StartDate, StringFormat=d}"  />
                            <DataGridTextColumn Header="EndDate" Width="*" Binding="{Binding EndDate, StringFormat=d}" />
                            <DataGridTextColumn Header="Company" Width="95" Binding="{Binding Name}" />
                            <DataGridTextColumn Header="Formula" Width="80" Binding="{Binding ContractFomulaId}" />
                            <DataGridTextColumn Header="Price" Width="60" Binding="{Binding Price}" />
                        </DataGrid.Columns>
                    </DataGrid>

                    <Button x:Name="btnRemoveContract" Content="Remove" HorizontalAlignment="Left" Height="29" Margin="11,197,0,0" VerticalAlignment="Top" Width="115" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnRemoveContract_Click" Grid.Column="4" RenderTransformOrigin="0.5,0.5" >
                        <Button.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform/>
                                <SkewTransform/>
                                <RotateTransform Angle="-0.069"/>
                                <TranslateTransform/>
                            </TransformGroup>
                        </Button.RenderTransform>
                    </Button>
                    <Button x:Name="btnUpdateContract" Content="Update" HorizontalAlignment="Left" Height="29" Margin="10,140,0,0" VerticalAlignment="Top" Width="117" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnUpdateContract_Click" Grid.Column="4"/>
                    <Button x:Name="btnCreateContract" Content="Create" HorizontalAlignment="Left" Height="29" Margin="10,83,0,0" VerticalAlignment="Top" Width="117" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnCreateContract_Click" Grid.Column="4"/>
                </Grid>
            </TabItem>

            <TabItem Header="Reservations" Width="178">
                <Grid Background="White" Margin="-14,-3,14,3">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="297*"/>
                        <ColumnDefinition Width="17"/>
                        <ColumnDefinition Width="103*"/>
                        <ColumnDefinition Width="47*"/>
                        <ColumnDefinition Width="36*"/>
                        <ColumnDefinition Width="60*"/>
                        <ColumnDefinition Width="394*"/>
                    </Grid.ColumnDefinitions>
                    <DataGrid x:Name="dtgReservations" AutoGenerateColumns="False" ItemsSource="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,49,0,0" Height="236" Width="573" Grid.ColumnSpan="7" IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="StartDate" Width="130" Binding="{Binding StartDate, StringFormat=d}" />
                            <DataGridTextColumn Header="Location" Width="130" Binding="{Binding Name}" />
                            <DataGridTextColumn Header="Company" Width="160" Binding="{Binding CompanyName}" />
                        </DataGrid.Columns>
                    </DataGrid>
                    <Button x:Name="btnRemoveReservation" Content="Remove" HorizontalAlignment="Left" Height="29" Margin="59,80,0,0" VerticalAlignment="Top" Width="97" BorderBrush="#CC119EDA" Background="#CC119EDA" Foreground="White" Click="btnRemoveReservation_Click" Grid.Column="6" />
                </Grid>
            </TabItem>

            <TabItem Header="Activity log" Width="187">
                <Grid Background="White" Margin="-14,-3,14,3">
                    <Grid HorizontalAlignment="Left" Height="277" Margin="10,10,0,0" Width="550">
                        <ScrollViewer Height="Auto">
                            <TextBlock x:Name="TxtEventsBlock" TextWrapping="Wrap" VerticalAlignment="Top" Width="Auto" Height="Auto"/>
                        </ScrollViewer>
                    </Grid>

                </Grid>
            </TabItem>
        </TabControl>
        <Image HorizontalAlignment="Left" Height="26" Margin="933,20,0,0" VerticalAlignment="Top" Width="33" RenderTransformOrigin="0.57,0.53" Source="Resources/System-Logout-icon.png" MouseLeftButtonUp="image_MouseLeftButtonUp"/>


    </Grid>
</controls:MetroWindow>
